home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / System / XADmaster / xad_dev / Include / ASM / libraries / xadmaster.i
Encoding:
Text File  |  2001-04-01  |  25.3 KB  |  630 lines

  1.     IFND    LIBRARIES_XADMASTER_I
  2. LIBRARIES_XADMASTER_I    SET    1
  3.  
  4. *
  5. *    $VER: xadmaster.i 10.0 (22.03.2001)
  6. *    xadmaster.library defines and structures
  7. *
  8. *    Copyright © 1998-2001 by Dirk Stöcker
  9. *    All Rights Reserved.
  10. *
  11.  
  12.     IFND    EXEC_LIBRARIES_I
  13.     INCLUDE    "exec/libraries.i"
  14.     ENDC
  15.  
  16.     IFND    UTILITY_TAGITEM_I
  17.     INCLUDE    "utility/tagitem.i"
  18.     ENDC
  19.  
  20. XADNAME    MACRO
  21.     DC.B  'xadmaster.library',0
  22.     ENDM
  23.  
  24. * NOTE: The structures do not have size labels, as they have no fixed
  25. * size. You always need to call xadAllocObject to get them
  26.  
  27. *************************************************************************
  28. *                                                *
  29. *    library base structure                        *
  30. *                                                *
  31. *************************************************************************
  32.  
  33.     STRUCTURE xadMasterBase,LIB_SIZE
  34.     APTR    xmb_SysBase
  35.     APTR    xmb_DOSBase
  36.     APTR    xmb_UtilityBase
  37.     ULONG    xmb_RecogSize        * read only
  38.       APTR    xmb_DefaultName        * name for XADFIF_NOFILENAME (V6)
  39.  
  40. *************************************************************************
  41. *                                                *
  42. *    tag-function call flags                               *
  43. *                                                *
  44. *************************************************************************
  45.  
  46. * input tags for xadGetInfo, only one can be specified per call
  47. XAD_INSIZE        EQU    (TAG_USER+001) * input data size
  48. XAD_INFILENAME        EQU    (TAG_USER+002)
  49. XAD_INFILEHANDLE    EQU    (TAG_USER+003)
  50. XAD_INMEMORY        EQU    (TAG_USER+004)
  51. XAD_INHOOK        EQU    (TAG_USER+005)
  52. XAD_INSPLITTED        EQU    (TAG_USER+006) * (V2)
  53. XAD_INDISKARCHIVE    EQU    (TAG_USER+007) * (V4)
  54. XAD_INXADSTREAM        EQU    (TAG_USER+008) * (V8)
  55.  
  56. * output tags, only one can be specified per call, xadXXXXUnArc
  57. XAD_OUTSIZE        EQU    (TAG_USER+010) * output data size
  58. XAD_OUTFILENAME        EQU    (TAG_USER+011)
  59. XAD_OUTFILEHANDLE    EQU    (TAG_USER+012)
  60. XAD_OUTMEMORY        EQU    (TAG_USER+013)
  61. XAD_OUTHOOK        EQU    (TAG_USER+014)
  62. XAD_OUTDEVICE        EQU    (TAG_USER+015) * for disk archives only
  63. XAD_OUTXADSTREAM    EQU    (TAG_USER+016) * (V8)
  64.  
  65. * object allocation tags for xadAllocObjectA
  66. XAD_OBJNAMESIZE        EQU    (TAG_USER+020) * XADOBJ_FILEINFO, size of needed name space
  67. XAD_OBJCOMMENTSIZE    EQU    (TAG_USER+021) * XADOBJ_FILEINFO, size of needed comment space
  68. XAD_OBJPRIVINFOSIZE    EQU    (TAG_USER+022) * XADOBJ_FILEINFO & XADOBJ_DISKINFO, self use size
  69. XAD_OBJBLOCKENTRIES    EQU    (TAG_USER+023) * XADOBJ_DISKINFO, number of needed entries
  70.  
  71. * tags for xadGetInfo, xadFileUnArc and xadDiskUnArc
  72. XAD_NOEXTERN        EQU    (TAG_USER+050) * do not use extern clients
  73. XAD_PASSWORD        EQU    (TAG_USER+051) * password when needed
  74. XAD_ENTRYNUMBER        EQU    (TAG_USER+052) * number of wanted entry
  75. XAD_PROGRESSHOOK    EQU    (TAG_USER+053) * the progress hook
  76. XAD_OVERWRITE        EQU    (TAG_USER+054) * overwrite file ?
  77. XAD_MAKEDIRECTORY    EQU    (TAG_USER+055) * create directory tree
  78. XAD_IGNOREGEOMETRY    EQU    (TAG_USER+056) * ignore drive geometry ?
  79. XAD_LOWCYLINDER        EQU    (TAG_USER+057) * lowest cylinder
  80. XAD_HIGHCYLINDER    EQU    (TAG_USER+058) * highest cylinder
  81. XAD_VERIFY        EQU    (TAG_USER+059) * verify for disk hook
  82. XAD_NOKILLPARTIAL    EQU    (TAG_USER+060) * do not delete partial/corrupt files (V3.3)
  83. XAD_FORMAT        EQU    (TAG_USER+061) * format output device (V5)
  84. XAD_USESECTORLABELS    EQU    (TAG_USER+062) * sector labels are stored on disk (V9)
  85.  
  86. * input tags for xadConvertDates, only one can be passed
  87. XAD_DATEUNIX        EQU    (TAG_USER+070) * unix date variable
  88. XAD_DATEAMIGA        EQU    (TAG_USER+071) * amiga date variable
  89. XAD_DATEDATESTAMP    EQU    (TAG_USER+072) * struct DateStamp
  90. XAD_DATEXADDATE        EQU    (TAG_USER+073) * struct xadDate
  91. XAD_DATECLOCKDATA    EQU    (TAG_USER+074) * struct ClockData
  92. XAD_DATECURRENTTIME    EQU    (TAG_USER+075) * input is system time
  93. XAD_DATEMSDOS        EQU    (TAG_USER+076) * MS-DOS packed format (V2)
  94. XAD_DATEMAC        EQU    (TAG_USER+077) * Mac date variable (V8)
  95. XAD_DATECPM             EQU    (TAG_USER+078) * CP/M data structure (V10)
  96. XAD_DATECPM2            EQU    (TAG_USER+079) * CP/M data structure type 2 (V10)
  97.  
  98. * output tags, there can be specified multiple tags for one call
  99. XAD_GETDATEUNIX     EQU    (TAG_USER+080) * unix date variable
  100. XAD_GETDATEAMIGA    EQU    (TAG_USER+081) * amiga date variable
  101. XAD_GETDATEDATESTAMP    EQU    (TAG_USER+082) * struct DateStamp
  102. XAD_GETDATEXADDATE    EQU    (TAG_USER+083) * struct xadDate
  103. XAD_GETDATECLOCKDATA    EQU    (TAG_USER+084) * struct ClockData
  104. XAD_GETDATEMSDOS    EQU    (TAG_USER+086) * MS-DOS packed format (V2)
  105. XAD_GETDATEMAC        EQU    (TAG_USER+087) * Mac date variable (V8)
  106. XAD_GETDATECPM          EQU    (TAG_USER+088) * CP/M data structure (V10)
  107. XAD_GETDATECPM2         EQU    (TAG_USER+089) * CP/M data structure type 2 (V10)
  108.  
  109. * following tags need locale.library to be installed
  110. XAD_MAKEGMTDATE        EQU    (TAG_USER+090) * make local to GMT time
  111. XAD_MAKELOCALDATE    EQU    (TAG_USER+091) * make GMT to local time
  112.  
  113. * tags for xadHookTagAccess (V3)
  114. XAD_USESKIPINFO        EQU    (TAG_USER+104) * the hook uses xadSkipInfo (V3)
  115. XAD_SECTORLABELS    EQU    (TAG_USER+105) * pass sector labels with XADAC_WRITE (V9)
  116.  
  117. XAD_GETCRC16        EQU    (TAG_USER+120) * pointer to UWORD value (V3)
  118. XAD_GETCRC32        EQU    (TAG_USER+121) * pointer to ULONG value (V3)
  119.  
  120. XAD_CRC16ID        EQU    (TAG_USER+130) * ID for crc calculation (V3)
  121. XAD_CRC32ID        EQU    (TAG_USER+131) * ID for crc calculation (V3)
  122.  
  123. * tags for xadConvertProtection (V4)
  124. XAD_PROTAMIGA        EQU    (TAG_USER+160) * Amiga type protection bits (V4)
  125. XAD_PROTUNIX        EQU    (TAG_USER+161) * protection bits in UNIX mode (V4)
  126. XAD_PROTMSDOS        EQU    (TAG_USER+162) * MSDOS type protection bits (V4)
  127.  
  128. XAD_GETPROTAMIGA    EQU    (TAG_USER+170) * return Amiga protection bits (V4)
  129.  
  130. * tags for xadGetDiskInfo (V7)
  131. XAD_STARTCLIENT        EQU    (TAG_USER+180) * the client to start with (V7)
  132. XAD_NOEMPTYERROR    EQU    (TAG_USER+181) * do not create XADERR_EMPTY (V8)
  133.  
  134. * tags for xadFreeHookAccess (V8)
  135. XAD_WASERROR        EQU    (TAG_USER+190) * error occured, call abort method (V8)
  136.  
  137. * tags for miscellaneous stuff
  138. XAD_ARCHIVEINFO        EQU    (TAG_USER+200) * xadArchiveInfo for stream hooks (V8)
  139.  
  140. * tags for xadAddFileEntry and xadAddDiskEntry (V10)
  141. XAD_SETINPOS            EQU    (TAG_USER+240) * set xai_InPos after call (V10)
  142. XAD_INSERTDIRSFIRST     EQU    (TAG_USER+241) * insert dirs at list start (V10)
  143.  
  144. *************************************************************************
  145. *                                                *
  146. *    objects for xadAllocObjectA                           *
  147. *                                                *
  148. *************************************************************************
  149.  
  150. XADOBJ_ARCHIVEINFO    EQU    $0001 * struct xadArchiveInfo
  151. XADOBJ_FILEINFO        EQU    $0002 * struct xadFileInfo
  152. XADOBJ_DISKINFO        EQU    $0003 * struct xadDiskInfo
  153. XADOBJ_HOOKPARAM    EQU    $0004 * struct HookParam
  154. XADOBJ_DEVICEINFO    EQU    $0005 * struct xadDeviceInfo
  155. XADOBJ_PROGRESSINFO    EQU    $0006 * struct xadProgressInfo
  156. XADOBJ_TEXTINFO        EQU    $0007 * struct xadTextInfo
  157. XADOBJ_SPLITFILE    EQU    $0008 * struct xadSplitFile (V2)
  158. XADOBJ_SKIPINFO        EQU    $0009 * struct xadSkipInfo (V3)
  159. XADOBJ_IMAGEINFO    EQU    $000A * struct xadImageInfo (V4)
  160.  
  161. * result type of xadAllocVec
  162. XADOBJ_MEMBLOCK        EQU    $0100 * memory of requested size and type
  163.  
  164. *************************************************************************
  165. *                                                *
  166. *    modes for xadCalcCRC126 and xadCalcCRC32                *
  167. *                                                *
  168. *************************************************************************
  169.  
  170. XADCRC16_ID1        EQU    $A001
  171. XADCRC32_ID1        EQU    $EDB88320
  172.  
  173. *************************************************************************
  174. *                                                *
  175. *    hook related stuff                                *
  176. *                                                *
  177. *************************************************************************
  178.  
  179. XADHC_READ    EQU    1    * read data into buffer
  180. XADHC_WRITE    EQU    2    * write buffer data to file/memory
  181. XADHC_SEEK    EQU    3    * seek in file
  182. XADHC_INIT    EQU    4    * initialize the hook
  183. XADHC_FREE    EQU    5    * end up hook work, free stuff
  184. XADHC_ABORT    EQU    6    * an error occured, delete partial stuff
  185. XADHC_FULLSIZE    EQU    7    * complete input size is needed
  186. XADHC_IMAGEINFO    EQU    8    * return disk image info (V4)
  187.  
  188.     STRUCTURE xadHookParam,0
  189.       ULONG    xhp_Command
  190.     ULONG    xhp_CommandData
  191.     APTR    xhp_BufferPtr
  192.       LONG    xhp_BufferSize
  193.       LONG    xhp_DataPos    * current seek position
  194.       APTR    xhp_PrivatePtr
  195.     APTR    xhp_TagList    * allows to transport tags to hook (V9)
  196.  
  197. * xadHookAccess commands
  198. XADAC_READ        EQU    10    * get data
  199. XADAC_WRITE        EQU    11    * write data
  200. XADAC_COPY        EQU    12    * copy input to output
  201. XADAC_INPUTSEEK        EQU    13    * seek in input file
  202. XADAC_OUTPUTSEEK    EQU    14    * seek in output file
  203.  
  204. *************************************************************************
  205. *                                                *
  206. *    support structures                              *
  207. *                                                *
  208. *************************************************************************
  209.  
  210. * Own date structure to cover all possible dates in a human friendly
  211. * format. xadConvertDates may be used to convert between different date
  212. * structures and variables.
  213.     STRUCTURE xadDate,0
  214.       ULONG     xd_Micros    * values 0 to 999999
  215.       LONG      xd_Year         * values 1 to 2147483648
  216.       UBYTE     xd_Month    * values 1 to 12
  217.       UBYTE     xd_WeekDay    * values 1 to 7
  218.       UBYTE     xd_Day        * values 1 to 31
  219.       UBYTE     xd_Hour        * values 0 to 23
  220.       UBYTE     xd_Minute    * values 0 to 59
  221.       UBYTE     xd_Second    * values 0 to 59
  222.       LABEL     xadDate_SIZE
  223.  
  224. XADDAY_MONDAY        EQU    1    * monday is the first day and
  225. XADDAY_TUESDAY        EQU    2
  226. XADDAY_WEDNESDAY    EQU    3
  227. XADDAY_THURSDAY        EQU    4
  228. XADDAY_FRIDAY        EQU    5
  229. XADDAY_SATURDAY     EQU    6
  230. XADDAY_SUNDAY        EQU    7    * sunday the last day of a week
  231.  
  232.     STRUCTURE xadDeviceInfo,0    * for XAD_OUTDEVICE tag
  233.     APTR    xdi_DeviceName    * name of device
  234.     ULONG    xdi_Unit    * unit of device
  235.     APTR    xdi_DOSName    * instead of Device+Unit, dos name without ':'
  236.  
  237.     STRUCTURE xadSplitFile,0    * for XAD_INSPLITTED
  238.       APTR    xsf_Next
  239.     ULONG    xsf_Type    * XAD_INFILENAME, XAD_INFILEHANDLE, XAD_INMEMORY, XAD_INHOOK
  240.     ULONG    xsf_Size    * necessary for XAD_INMEMORY, useful for others
  241.     ULONG    xsf_Data    * FileName, Filehandle, Hookpointer or Memory
  242.  
  243.     STRUCTURE xadSkipInfo,0
  244.     APTR    xsi_Next
  245.     ULONG    xsi_Position    * position, where it should be skipped
  246.     ULONG    xsi_SkipSize    * size to skip
  247.  
  248.     STRUCTURE xadImageInfo,0    * for XADHC_IMAGEINFO
  249.     ULONG xii_SectorSize    * usually 512
  250.     ULONG xii_FirstSector    * of the image file
  251.     ULONG xii_NumSectors    * of the image file
  252.     ULONG xii_TotalSectors    * of this device type
  253.     * If the image file holds total data of disk xii_TotalSectors equals
  254.        * xii_NumSectors and xii_FirstSector is zero. Addition of xii_FirstSector
  255.     * and xii_NumSectors cannot exceed xii_TotalSectors value!
  256.  
  257. *************************************************************************
  258. *                                                *
  259. *    information structures                              *
  260. *                                                *
  261. *************************************************************************
  262.  
  263.     STRUCTURE xadArchiveInfo,0
  264.       APTR    xai_Client      * pointer to unarchiving client
  265.     APTR    xai_PrivateClient * private client data
  266.     APTR    xai_Password      * password for crypted archives
  267.     ULONG    xai_Flags        * read only XADAIF_ flags
  268.     ULONG    xai_LowCyl       * lowest cylinder to unarchive
  269.     ULONG    xai_HighCyl      * highest cylinder to unarchive
  270.     ULONG    xai_InPos        * input position, read only
  271.     ULONG    xai_InSize       * input size, read only
  272.     ULONG    xai_OutPos       * output position, read only
  273.     ULONG    xai_OutSize      * output file size, read only
  274.     APTR    xai_FileInfo      * data pointer for file arcs
  275.     APTR    xai_DiskInfo      * data pointer for disk arcs
  276.     APTR    xai_CurFile      * data pointer for current file arc
  277.     APTR    xai_CurDisk      * data pointer for current disk arc
  278.       LONG    xai_LastError      * last error, when XADAIF_FILECORRUPT (V2)
  279.     APTR    xai_MultiVolume      * array of start offsets from parts (V2)
  280.     APTR    xai_SkipInfo      * linked list of skip entries (V3)
  281.       APTR    xai_ImageInfo      * for filesystem clients (V5)
  282.     APTR    xai_InName      * Input archive name if available (V7)
  283.  
  284. * This structure is nearly complete private to either xadmaster or its
  285. * clients. An application program may access for reading only xai_Client,
  286. * xai_Flags, xai_FileInfo and xai_DiskInfo. For xai_Flags only XADAIF_CRYPTED
  287. * is useful. All the other stuff is private and should not be accessed!
  288.  
  289.     BITDEF XADAI,CRYPTED,0        * archive entries are encrypted
  290.     BITDEF XADAI,FILECORRUPT,1    * file is corrupt, but valid entries are in the list
  291.     BITDEF XADAI,FILEARCHIVE,2    * unarchive file entry
  292.     BITDEF XADAI,DISKARCHIVE,3    * unarchive disk entry
  293.     BITDEF XADAI,OVERWRITE,4    * overwrite the file (PRIVATE)
  294.     BITDEF XADAI,MAKEDIRECTORY,5    * create directory when missing (PRIVATE)
  295.     BITDEF XADAI,IGNOREGEOMETRY,6    * ignore drive geometry (PRIVATE)
  296.     BITDEF XADAI,VERIFY,7        * verify is turned on for disk hook (PRIVATE)
  297.     BITDEF XADAI,NOKILLPARTIAL,8    * do not delete partial files (PRIVATE)
  298.     BITDEF XADAI,DISKIMAGE,9    * is disk image extraction (V5)
  299.     BITDEF XADAI,FORMAT,10        * format in disk hook (PRIVATE)
  300.     BITDEF XADAI,NOEMPTYERROR,11    * do not create empty error (PRIVATE)
  301.     BITDEF XADAI,ONLYIN,12        * in stuff only (PRIVATE)
  302.     BITDEF XADAI,ONLYOUT,13        * out stuff only (PRIVATE)
  303.     BITDEF XADAI,USESECTORLABELS,14 * use SectorLabels (PRIVATE)
  304.  
  305.     STRUCTURE xadFileInfo,0
  306.     APTR    xfi_Next
  307.     ULONG    xfi_EntryNumber    * number of entry, starts with 1
  308.     APTR    xfi_EntryInfo      * additional archiver text
  309.     APTR    xfi_PrivateInfo    * client private, see XAD_OBJPRIVINFOSIZE
  310.     ULONG    xfi_Flags          * see XADFIF_xxx defines
  311.     APTR    xfi_FileName       * see XAD_OBJNAMESIZE tag
  312.     APTR    xfi_Comment        * see XAD_OBJCOMMENTSIZE tag
  313.     ULONG      xfi_Protection     * OS 3 bits (including multiuser)
  314.     ULONG    xfi_OwnerUID       * user ID
  315.     ULONG    xfi_OwnerGID       * group ID
  316.     APTR    xfi_UserName       * user name
  317.     APTR    xfi_GroupName      * group name
  318.     ULONG   xfi_Size           * size of this file
  319.     ULONG    xfi_GroupCrSize    * crunched size of group
  320.     ULONG    xfi_CrunchSize     * crunched size
  321.     APTR    xfi_LinkName       * name and path of link
  322.     STRUCT    xfi_Date,xadDate_SIZE
  323.     UWORD   xfi_Generation  * File Generation [0...$FFFF] (V3)
  324.     ULONG    xfi_DataPos     * crunched data position (V3)
  325.     APTR    xfi_MacFork     * pointer to 2nd fork for Mac (V7)
  326.  
  327. * Multiuser fields (xfi_OwnerUID, xfi_OwnerUID, xfi_UserName, xfi_GroupName)
  328. * and multiuser bits (see <dos/dos.h>) are currently not supported with normal
  329. * Amiga filesystem. But the clients support them, if archive format holds
  330. * such information.
  331.  
  332.     BITDEF XADFI,CRYPTED,0        * entry is crypted
  333.     BITDEF XADFI,DIRECTORY,1    * entry is a directory
  334.     BITDEF XADFI,LINK,2        * entry is a link
  335.     BITDEF XADFI,INFOTEXT,3        * file is an information text
  336.     BITDEF XADFI,GROUPED,4        * file is in a crunch group
  337.     BITDEF XADFI,ENDOFGROUP,5    * crunch group ends here
  338.     BITDEF XADFI,NODATE,6        * no date supported, CURRENT date is set
  339.     BITDEF XADFI,DELETED,7        * file is marked as deleted (V3)
  340.     BITDEF XADFI,SEEKDATAPOS,8    * before unarchiving the datapos is set (V3)
  341.     BITDEF XADFI,NOFILENAME,9    * there was no filename, using internal one (V6)
  342.     BITDEF XADFI,NOUNCRUNCHSIZE,10    * file size is unknown and thus set to zero (V6)
  343.     BITDEF XADFI,PARTIALFILE,11    * file is only partial (V6)
  344.     BITDEF XADFI,MACDATA,12        * file is Apple data fork (V7)
  345.     BITDEF XADFI,MACRESOURCE,13    * file is Apple resource fork (V7)
  346.     BITDEF XADFI,EXTRACTONBUILD,14  * allows extract file during scanning (V10)
  347.  
  348. * NOTE: the texts passed with that structure must not always be printable.
  349. * Although the clients should add an additional (not counted) zero at the text
  350. * end, the whole file may contain other unprintable stuff (e.g. for DMS).
  351. * So when printing this texts do it on a byte for byte base including
  352. * printability checks.
  353.  
  354.     STRUCTURE xadTextInfo,0
  355.     APTR    xti_Next
  356.     ULONG    xti_Size    * maybe zero - no text - e.g. when crypted
  357.     APTR    xti_Text    * and there is no password in xadGetInfo()
  358.     ULONG    xti_Flags    * see XADTIF_xxx defines
  359.  
  360.     BITDEF    XADTI,CRYPTED,0    * entry is empty, as data was crypted
  361.     BITDEF    XADTI,BANNER,1    * text is a banner
  362.     BITDEF    XADTI,FILEDIZ,2    * text is a file description
  363.  
  364.     STRUCTURE xadDiskInfo,0
  365.     APTR    xdi_Next
  366.     ULONG    xdi_EntryNumber      * number of entry, starts with 1
  367.     APTR    xdi_EntryInfo        * additional archiver text
  368.     APTR    xdi_PrivateInfo      * client private, see XAD_OBJPRIVINFOSIZE
  369.     ULONG    xdi_Flags         * see XADDIF_xxx defines
  370.     ULONG    xdi_SectorSize
  371.     ULONG    xdi_TotalSectors    * see devices/trackdisk.h
  372.     ULONG    xdi_Cylinders        * to find out what these
  373.     ULONG    xdi_CylSectors          * fields mean, they are equal
  374.     ULONG    xdi_Heads          * to struct DriveGeometry
  375.     ULONG    xdi_TrackSectors
  376.     ULONG    xdi_LowCyl           * lowest cylinder stored
  377.     ULONG    xdi_HighCyl          * highest cylinder stored
  378.     ULONG    xdi_BlockInfoSize    * number of BlockInfo entries
  379.     APTR    xdi_BlockInfo        * see XADBIF_xxx defines and XAD_OBJBLOCKENTRIES tag
  380.     APTR    xdi_TextInfo        * linked list with info texts
  381.     ULONG    xdi_DataPos        * crunched data position (V3)
  382.  
  383. * BlockInfo points to a UBYTE field for every track from first sector of
  384. * lowest cylinder to last sector of highest cylinder. When not used,
  385. * pointer must be 0. Do not use it, when there are no entries!
  386. * This is just for information. The applications still asks the client
  387. * to unarchive whole cylinders and not archived blocks are cleared for
  388. * unarchiving.
  389.     BITDEF XADDI,CRYPTED,0        * entry is crypted
  390.     BITDEF XADDI,SEEKDATAPOS,1    * before unarchiving the datapos is set (V3)
  391.     BITDEF XADDI,SECTORLABELS,2    * the clients delivers sector labels (V9)
  392.     BITDEF XADDI,EXTRACTONBUILD,3   * allows extract disk during scanning (V10)
  393.  
  394. * Some of the crunchers do not store all necessary information, so it
  395. * may be needed to guess some of them. Set the following flags in that case
  396. * and geometry check will ignore these fields.
  397.     BITDEF XADDI,GUESSSECTORSIZE,5    * sectorsize is guessed (V10)
  398.     BITDEF XADDI,GUESSTOTALSECTORS,6  * totalsectors number is guessed (V10)
  399.     BITDEF XADDI,GUESSCYLINDERS,7      * cylinder number is guessed
  400.     BITDEF XADDI,GUESSCYLSECTORS,8      * cylsectors is guessed
  401.     BITDEF XADDI,GUESSHEADS,9      * number of heads is guessed
  402.     BITDEF XADDI,GUESSTRACKSECTORS,10 * tracksectors is guessed
  403.     BITDEF XADDI,GUESSLOWCYL,11      * lowcyl is guessed
  404.     BITDEF XADDI,GUESSHIGHCYL,12      * highcyl is guessed
  405.  
  406. * If it is impossible to set some of the fields, you need to set some of
  407. * these flags. NOTE: XADDIB_NOCYLINDERS is really important, as this turns
  408. * of usage of lowcyl and highcyl keywords. When you have cylinder information,
  409. * you should not use these and instead use guess flags and calculate
  410. * possible values for the missing fields.
  411.     BITDEF XADDI,NOCYLINDERS,15    * cylinder number is not set
  412.     BITDEF XADDI,NOCYLSECTORS,16    * cylsectors is not set
  413.     BITDEF XADDI,NOHEADS,17        * number of heads is not set
  414.     BITDEF XADDI,NOTRACKSECTORS,18    * tracksectors is not set
  415.     BITDEF XADDI,NOLOWCYL,19    * lowcyl is not set
  416.     BITDEF XADDI,NOHIGHCYL,20    * highcyl is not set
  417.  
  418. * defines for BlockInfo
  419.     BITDEF XADBI,CLEARED,0    * this block was cleared for archiving
  420.     BITDEF XADBI,UNUSED,1    * this block was not archived
  421.  
  422. *************************************************************************
  423. *                                                *
  424. *    progress report stuff                              *
  425. *                                                *
  426. *************************************************************************
  427.  
  428.     STRUCTURE xadProgressInfo,0
  429.     ULONG    xpi_Mode    * work modus
  430.     APTR    xpi_Client    * the client doing the work
  431.     APTR    xpi_DiskInfo    * current diskinfo, for disks
  432.     APTR    xpi_FileInfo    * current info for files
  433.     ULONG    xpi_CurrentSize    * current filesize
  434.     ULONG    xpi_LowCyl    * for disks only
  435.     ULONG    xpi_HighCyl    * for disks only
  436.     ULONG    xpi_Status    * see XADPIF flags
  437.     LONG    xpi_Error    * any of the error codes
  438.     APTR    xpi_FileName    * name of file to overwrite (V2)
  439.     APTR    xpi_NewName    * new name buffer, passed by hook (V2)
  440. * NOTE: For disks CurrentSize is Sector*SectorSize, where SectorSize can
  441. * be found in xadDiskInfo structure. So you may output the sector value.
  442.  
  443. * different progress modes
  444. XADPMODE_ASK        EQU    1
  445. XADPMODE_PROGRESS    EQU    2
  446. XADPMODE_END        EQU    3
  447. XADPMODE_ERROR        EQU    4
  448. XADPMODE_NEWENTRY       EQU    5 * (V10)
  449.  
  450. * flags for progress hook and ProgressInfo status field
  451.     BITDEF XADPI,OVERWRITE,0    * overwrite the file
  452.     BITDEF XADPI,MAKEDIRECTORY,1    * create the directory
  453.     BITDEF XADPI,IGNOREGEOMETRY,2    * ignore drive geometry
  454.     BITDEF XADPI,ISDIRECTORY,3    * destination is a directory (V10)
  455.     BITDEF XADPI,RENAME,10        * rename the file (V2)
  456.     BITDEF XADPI,OK,16        * all ok, proceed
  457.     BITDEF XADPI,SKIP,17        * skip file
  458.  
  459. *************************************************************************
  460. *                                                *
  461. *    errors                                       *
  462. *                                                *
  463. *************************************************************************
  464.  
  465. XADERR_OK        EQU    $0000 * no error
  466. XADERR_UNKNOWN        EQU    $0001 * unknown error
  467. XADERR_INPUT        EQU    $0002 * input data buffers border exceeded
  468. XADERR_OUTPUT        EQU    $0003 * output data buffers border exceeded
  469. XADERR_BADPARAMS    EQU    $0004 * function called with illegal parameters
  470. XADERR_NOMEMORY        EQU    $0005 * not enough memory available
  471. XADERR_ILLEGALDATA    EQU    $0006 * data is corrupted
  472. XADERR_NOTSUPPORTED    EQU    $0007 * command is not supported
  473. XADERR_RESOURCE        EQU    $0008 * required resource missing
  474. XADERR_DECRUNCH        EQU    $0009 * error on decrunching
  475. XADERR_FILETYPE        EQU    $000A * unknown file type
  476. XADERR_OPENFILE        EQU    $000B * opening file failed
  477. XADERR_SKIP        EQU    $000C * file, disk has been skipped
  478. XADERR_BREAK        EQU    $000D * user break in progress hook
  479. XADERR_FILEEXISTS    EQU    $000E * file already exists
  480. XADERR_PASSWORD        EQU    $000F * missing or wrong password
  481. XADERR_MAKEDIR        EQU    $0010 * could not create directory
  482. XADERR_CHECKSUM        EQU    $0011 * wrong checksum
  483. XADERR_VERIFY        EQU    $0012 * verify failed (disk hook)
  484. XADERR_GEOMETRY        EQU    $0013 * wrong drive geometry
  485. XADERR_DATAFORMAT    EQU    $0014 * unknown data format
  486. XADERR_EMPTY        EQU    $0015 * source file contains no files
  487. XADERR_FILESYSTEM    EQU    $0016 * unknown filesystem
  488. XADERR_FILEDIR        EQU    $0017 * name of file exists as directory
  489.  
  490. *************************************************************************
  491. *                                                *
  492. *    client related stuff                           *
  493. *                                                *
  494. *************************************************************************
  495.  
  496.     STRUCTURE xadForeman,0
  497.     ULONG    xfm_Security    * should be XADFOREMAN_SECURITY
  498.     ULONG    xfm_ID              * must be XADFOREMAN_ID
  499.     UWORD    xfm_Version     * set to XADFOREMAN_VERSION
  500.     UWORD    xfm_Reserved
  501.     APTR    xfm_VersString  * pointer to $VER: string
  502.     APTR    xfm_FirstClient * pointer to first client
  503.     LABEL    xadForman_SIZE
  504.  
  505. XADFOREMAN_SECURITY    EQU    $70FF4E75 * MOVEQ #-1,D0 and RTS
  506. XADFOREMAN_ID        EQU    $58414446 * 'XADF' identification ID
  507. XADFOREMAN_VERSION    EQU    1
  508.  
  509.     STRUCTURE xadClient,0
  510.     APTR    xc_Next
  511.     UWORD    xc_Version    * set to XADCLIENT_VERSION
  512.     UWORD    xc_MasterVersion
  513.     UWORD    xc_ClientVersion
  514.     UWORD    xc_ClientRevision
  515.     ULONG    xc_RecogSize    * needed size to recog the type
  516.     ULONG    xc_Flags    * see XADCF_xxx defines
  517.     ULONG    xc_Identifier    * ID of internal clients
  518.     APTR    xc_ArchiverName
  519.     APTR    xc_RecogData
  520.     APTR    xc_GetInfo
  521.     APTR    xc_UnArchive
  522.     APTR    xc_Free
  523.     LABEL    xadClient_SIZE
  524.  
  525. * function interface
  526. * ASM(BOOL) xc_RecogData(REG(d0, ULONG size), REG(a0, STRPTR data),
  527. *        REG(a6, struct xadMasterBase *xadMasterBase))
  528. * ASM(LONG) xc_GetInfo(REG(a0, struct xadArchiveInfo *ai),
  529. *        REG(a6, struct xadMasterBase *xadMasterBase))
  530. * ASM(LONG) xc_UnArchive(REG(a0, struct xadArchiveInfo *ai),
  531. *        REG(a6, struct xadMasterBase *xadMasterBase))
  532. * ASM(void) xc_Free(REG(a0, struct xadArchiveInfo *ai),
  533. *        REG(a6, struct xadMasterBase *xadMasterBase))
  534.  
  535.  
  536. * xc_RecogData returns 1 when recognized and 0 when not, all the others
  537. * return 0 when ok and XADERR values on error. xc_Free has no return
  538. * value.
  539.  
  540. * Filesystem clients need to clear xc_RecogSize and xc_RecogData. The
  541. * recognition is automatically done by GetInfo. XADERR_FILESYSTEM is
  542. * returned in case of unknown format. If it is known detection should
  543. * go on and any other code may be returned, if it fails.
  544. * The field xc_ArchiverName means xc_FileSystemName for filesystem
  545. * clients.
  546.  
  547. XADCLIENT_VERSION    EQU    1
  548.  
  549.     BITDEF XADC,FILEARCHIVER,0    * archiver is a file archiver
  550.     BITDEF XADC,DISKARCHIVER,1    * archiver is a disk archiver
  551.     BITDEF XADC,EXTERN,2        * external client, set by xadmaster
  552.     BITDEF XADC,FILESYSTEM,3    * filesystem clients (V5)
  553.     BITDEF XADC,NOCHECKSIZE,4    * do not check size for recog call (V6)
  554.     BITDEF XADC,FREESKIPINFO,27    * master frees xadSkipInfo structures (V3)
  555.     BITDEF XADC,FREETEXTINFO,28    * master frees xadTextInfo structures (V2)
  556.     BITDEF XADC,FREETEXTINFOTEXT,29    * master frees xadTextInfo text block (V2)
  557.     BITDEF XADC,FREEFILEINFO,30    * master frees xadFileInfo structures (V2)
  558.     BITDEF XADC,FREEDISKINFO,31    * master frees xadDiskInfo structures (V2)
  559.  
  560. *************************************************************************
  561. *                                                *
  562. *    client ID's                                   *
  563. *                                                *
  564. *************************************************************************
  565.  
  566. * If an external client has set the xc_Identifier field, the internal
  567. * client is replaced.
  568.  
  569. * disk archivers start with 1000
  570. XADCID_XMASH            EQU    1000
  571. XADCID_SUPERDUPER3        EQU    1001
  572. XADCID_XDISK            EQU    1002
  573. XADCID_PACKDEV            EQU    1003
  574. XADCID_ZOOM            EQU    1004
  575. XADCID_ZOOM5            EQU    1005
  576. XADCID_CRUNCHDISK        EQU    1006
  577. XADCID_PACKDISK            EQU    1007
  578. XADCID_MDC            EQU    1008
  579. XADCID_COMPDISK            EQU    1009
  580. XADCID_LHWARP            EQU    1010
  581. XADCID_SAVAGECOMPRESSOR        EQU    1011
  582. XADCID_WARP            EQU    1012
  583. XADCID_GDC            EQU    1013
  584.  
  585. * file archivers start with 5000
  586. XADCID_TAR            EQU    5000
  587. XADCID_SDSSFX            EQU    5001
  588. XADCID_LZX            EQU    5002
  589. XADCID_MXMSIMPLEARC        EQU    5003
  590. XADCID_LHPAK            EQU    5004
  591. XADCID_AMIGAPLUSUNPACK        EQU    5005
  592. XADCID_AMIPACK            EQU    5006
  593. XADCID_LHA            EQU    5007
  594. XADCID_LHASFX            EQU    5008
  595. XADCID_PCOMPARC            EQU    5009
  596. XADCID_SOMNI            EQU    5010
  597. XADCID_LHSFX            EQU    5011
  598. XADCID_XPKARCHIVE        EQU    5012
  599. XADCID_SHRINK            EQU    5013
  600. XADCID_SPACK            EQU    5014
  601. XADCID_SPACKSFX            EQU    5015
  602. XADCID_ZIP            EQU    5016
  603. XADCID_WINZIPEXE        EQU    5017
  604. XADCID_GZIP            EQU    5018
  605. XADCID_ARC            EQU    5019
  606. XADCID_ZOO            EQU    5020
  607. XADCID_LHAEXE            EQU    5021
  608. XADCID_ARJ            EQU    5022
  609. XADCID_ARJEXE            EQU    5023
  610. XADCID_ZIPEXE            EQU    5024
  611. XADCID_LHF            EQU    5025
  612. XADCID_COMPRESS            EQU    5026
  613. XADCID_ACE            EQU    5027
  614. XADCID_ACEEXE            EQU    5028
  615. XADCID_GZIPSFX            EQU    5029
  616. XADCID_HA            EQU    5030
  617. XADCID_SQ            EQU    5031
  618. XADCID_LHAC64SFX        EQU    5032
  619.  
  620. * filesystem client start with 8000
  621. XADCID_FSAMIGA            EQU    8000
  622. XADCID_FSSANITYOS        EQU    8001
  623. XADCID_FSFAT            EQU    8002
  624.  
  625. * mixed archivers start with 9000
  626. XADCID_DMS            EQU    9000
  627. XADCID_DMSSFX            EQU    9001
  628.  
  629.     ENDC    ; LIBRARIES_XADMASTER_I
  630.